package com.future.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("article")
public class Article {
    @TableId(type = IdType.AUTO)
    @ApiModelProperty("文章ID")
    private Long id;
    @ApiModelProperty("文章标题")
    private String title;
    @ApiModelProperty("文章内容")
    private String content;
    @ApiModelProperty("作者ID")
    private Long authorId;

    @TableField(exist = false)
    private String authorIdStr;

    @ApiModelProperty("作者角色")
    private String authorRole;
    @ApiModelProperty("文章分类")
        private Long categoryId;
    @ApiModelProperty("是否审核通过")
    private Integer isApproved;
    @ApiModelProperty("创建时间")
    private LocalDateTime createdAt;
    @ApiModelProperty("更新时间")
    private LocalDateTime updatedAt;
    @ApiModelProperty("浏览量")
    private Long views;
    @ApiModelProperty("点赞数")
    private Long likeCount;

    @ApiModelProperty("收藏数")
    private Long collectionCount;
    @TableField(exist = false)
    @ApiModelProperty("标签ID")
    private List<Long> tagIds;
    @ApiModelProperty("文章图片")
    private String imageUrl;
    @TableField(exist = false)
    @ApiModelProperty("作者名称")
    private String authorName;

    @ApiModelProperty("当前用户是否点赞")
    @TableField(exist = false)
    private Boolean isLiked;
    @ApiModelProperty("当前用户是否收藏")
    @TableField(exist = false)
    private Boolean isCollected;
}
